package cn.signalpha.modules.shop.dto;

import cn.signalpha.modules.shop.vo.SellerDeliveryConfigVO;
import cn.signalpha.modules.shop.vo.SellerExtVO;
import cn.signalpha.modules.shop.vo.SellerPickConfigVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 数据传输对象实体类
 *
 * @author signalpha
 */
@Data
@ApiModel(value = "Seller对象", description = "商户")
public class SellerDTO implements Serializable {
    private static final long serialVersionUID = 1L;

	@Data
	public static class SystemSaveDTO implements Serializable {
		private static final long serialVersionUID = 1L;
//		@NotNull
//		@ApiModelProperty(value = "类型id")
//		private Long typeId;
		@NotNull
		@ApiModelProperty(value = "用户id")
		private Long userId;
		@NotNull
		@ApiModelProperty(value = "分类id")
		private Long categoryId;
		@NotBlank
		@ApiModelProperty(value = "名称")
		private String name;
		@ApiModelProperty(value = "关键字")
		private String keyword;
		@ApiModelProperty(value = "简介")
		private String brief;
		@ApiModelProperty(value = "logo")
		private String logo;
		@ApiModelProperty(value = "背景图")
		private String backImg;
		@ApiModelProperty(value = "街景图")
		private String streetImg;
		@ApiModelProperty(value = "资质图")
		private String licenseImg;
		@NotBlank
		@Pattern(regexp = "^(((13[0-9])|(14[579])|(15([0-3]|[5-9]))|(16[6])|(17[0135678])|(18[0-9])|(19[89]))\\d{8})$", message = "手机号格式错误")
		@ApiModelProperty(value = "电话")
		private String mobile;
		@ApiModelProperty(value = "负责人")
		private String legalPerson;
		@ApiModelProperty(value = "省")
		private String province;
		@ApiModelProperty(value = "市")
		private String city;
		@ApiModelProperty(value = "区")
		private String district;
		@ApiModelProperty(value = "地址")
		private String address;
		@ApiModelProperty(value = "经度")
		private String lng;
		@ApiModelProperty(value = "纬度")
		private String lat;
		@ApiModelProperty(value = "账号", hidden = true)
		private String account;
		@NotBlank
		@ApiModelProperty(value = "密码")
		private String password;
		@ApiModelProperty(value = "是否自营")
		private Integer isSelf;
		@ApiModelProperty(value = "是否推荐")
		private Integer isPush;
		@ApiModelProperty(value = "是否显示")
		private Integer isShow;
		@ApiModelProperty(value = "是否审核商品")
		private Integer isAuditGoods;
		@ApiModelProperty(value = "排序值")
		private Integer sort;
		@ApiModelProperty(value = "商户评分")
		private Integer score;
		@ApiModelProperty(value = "自定义手续费比例")
		private Double serverRatio;
		@ApiModelProperty(value = "自定义手续费开关：0关 1开")
		private Integer serverRatioSw;
		@ApiModelProperty(value = "扩展参数")
		private String ext;
		@ApiModelProperty(value = "扩展信息")
		private SellerExtVO extVO;
	}

	@Data
	public static class SystemUpdateDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@ApiModelProperty(value = "商户id")
		private Long id;
//		@NotNull
//		@ApiModelProperty(value = "类型id")
//		private Long typeId;
		@NotNull
		@ApiModelProperty(value = "用户id")
		private Long userId;
		@NotNull
		@ApiModelProperty(value = "分类id")
		private Long categoryId;
		@NotBlank
		@ApiModelProperty(value = "名称")
		private String name;
		@ApiModelProperty(value = "关键字")
		private String keyword;
		@ApiModelProperty(value = "简介")
		private String brief;
		@ApiModelProperty(value = "logo")
		private String logo;
		@ApiModelProperty(value = "背景图")
		private String backImg;
		@ApiModelProperty(value = "街景图")
		private String streetImg;
		@ApiModelProperty(value = "资质图")
		private String licenseImg;
//		@ApiModelProperty(value = "电话")
//		private String mobile;
		@ApiModelProperty(value = "负责人")
		private String legalPerson;
		@ApiModelProperty(value = "省")
		private String province;
		@ApiModelProperty(value = "市")
		private String city;
		@ApiModelProperty(value = "区")
		private String district;
		@ApiModelProperty(value = "地址")
		private String address;
		@ApiModelProperty(value = "经度")
		private String lng;
		@ApiModelProperty(value = "纬度")
		private String lat;
		@ApiModelProperty(value = "是否自营")
		private Integer isSelf;
		@ApiModelProperty(value = "是否推荐")
		private Integer isPush;
		@ApiModelProperty(value = "是否显示")
		private Integer isShow;
		@ApiModelProperty(value = "是否审核商品")
		private Integer isAuditGoods;
		@ApiModelProperty(value = "排序值")
		private Integer sort;
		@ApiModelProperty(value = "商户评分")
		private Integer score;
		@ApiModelProperty(value = "自定义手续费比例")
		private Double serverRatio;
		@ApiModelProperty(value = "自定义手续费开关：0关 1开")
		private Integer serverRatioSw;
		@ApiModelProperty(value = "更新时间", hidden = true)
		private Date updateTime;
		@ApiModelProperty(value = "扩展参数")
		private String ext;
		@ApiModelProperty(value = "扩展信息")
		private SellerExtVO extVO;
	}

	@Data
	public static class SystemUpdateIsDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@NotNull
		@ApiModelProperty(value = "商户id")
		private Long id;
		@ApiModelProperty(value = "是否自营")
		private Integer isSelf;
		@ApiModelProperty(value = "是否推荐")
		private Integer isPush;
		@ApiModelProperty(value = "是否显示")
		private Integer isShow;
		@ApiModelProperty(value = "是否审核商品")
		private Integer isAuditGoods;
		@ApiModelProperty(value = "更新时间", hidden = true)
		private Date updateTime;
	}

	@Data
	public static class SellerUpdateDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@ApiModelProperty(value = "商户id", hidden = true)
		private Long id;
		@ApiModelProperty(value = "名称")
		private String name;
		@ApiModelProperty(value = "关键字")
		private String keyword;
		@ApiModelProperty(value = "简介")
		private String brief;
		@ApiModelProperty(value = "logo")
		private String logo;
		@ApiModelProperty(value = "背景图")
		private String backImg;
		@ApiModelProperty(value = "街景图")
		private String streetImg;
		@ApiModelProperty(value = "资质图")
		private String licenseImg;
		@ApiModelProperty(value = "省")
		private String province;
		@ApiModelProperty(value = "市")
		private String city;
		@ApiModelProperty(value = "区")
		private String district;
		@ApiModelProperty(value = "地址")
		private String address;
		@ApiModelProperty(value = "经度")
		private String lng;
		@ApiModelProperty(value = "纬度")
		private String lat;
		@ApiModelProperty(value = "扩展参数")
		private String ext;
		@ApiModelProperty(value = "扩展信息")
		private SellerExtVO extVO;
	}

	@Data
	public static class SellerUpdatePickDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@ApiModelProperty(value = "商户id", hidden = true)
		private Long id;
		@NotNull
		@ApiModelProperty(value = "是否开启自提")
		private Integer isOpenPick;
		@ApiModelProperty(value = "自提配置")
		private List<SellerPickConfigVO> sellerPickConfigList;
	}

	@Data
	public static class SellerUpdateDeliveryDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@ApiModelProperty(value = "商户id", hidden = true)
		private Long id;
		@NotNull
		@ApiModelProperty(value = "是否开启同城配送")
		private Integer isOpenDelivery;
		@ApiModelProperty(value = "同城配送配置")
		private SellerDeliveryConfigVO sellerDeliveryConfig;
	}

	@Data
	public static class updatePasswordDTO implements Serializable {
		private static final long serialVersionUID = 1L;
		@ApiModelProperty(value = "商户id")
		private Long id;
		@NotBlank
		@ApiModelProperty(value = "密码")
		private String password;
		@ApiModelProperty(value = "更新时间", hidden = true)
		private Date updateTime;
	}

}
